package com.hmall.common.client;

import com.hmall.common.pojo.Address;
import com.hmall.user.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient("userservice")
public interface UserClient {

    /**
     * 根据地址id查询地址
     *
     * @param id 地址id
     * @return
     */
    @GetMapping("/address/{addressId}")
    public Address findAddresses(@PathVariable("addressId") Long id);

    @GetMapping("/user/{userId}")
    public User findUserById(@PathVariable("userId") Long userId);

    @RequestMapping("/user/{money}/{id}")
    public void updateUser(@PathVariable("money") Long money,
                           @PathVariable("id") Long id);

}
